﻿using System;
using Dng.DataFactory;
using ShippingManage.DataAccessor.Entities;

namespace ShippingManage.Models
{
	public class CustomerModel
	{
		#region save data

		/// <summary>
		/// Save VienDongShipping data
		/// </summary>
		/// <param name="obj"></param>
		public void Save(Customer obj)
		{
			ProviderFactory dataPF = new ProviderFactory(Global.I.ConnectionStringName);
			dataPF.OpenConnection();
			try
			{
				if (obj.Id == Guid.Empty)
					Insert(dataPF, obj);
				else
					Update(dataPF, obj);
			}
			finally
			{
				dataPF.CloseConnection();
			}
		}

		public void Insert(ProviderFactory data, Customer obj)
		{
			string sql = "INSERT INTO Customer()";
			var cmd = data.CreateCommand(sql);
			cmd.ExecuteNonQuery();
		}

		public void Update(ProviderFactory data, Customer obj)
		{

		}

		#endregion

		public bool IsExist(Customer obj)
		{
			return false;
		}
	}
}
